package com.qdu.servlet;

import com.qdu.entity.Join;
import com.qdu.service.JoinService;
import com.qdu.service.impl.JoinServiceImpl;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author Daniel
 */
@WebServlet("/gubps")
public class GetUsersByPnoServlet extends HttpServlet{
    
    JoinService js = new JoinServiceImpl();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        int Pno= Integer.parseInt(req.getParameter("Pno"));
        List<Join> list = js.findUsersByPno(Pno);
        req.setAttribute("join_list", list);
        req.getRequestDispatcher("/AllJoiners.jsp").forward(req, resp);
    }
    
}
